﻿using Soft.Net;
using Soft.Xml;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Soft.Service
{

    /// <summary>
    /// 本地jobXml配置文件
    /// </summary>
    public sealed class LocalJobServiceConfig : BaseConfiguration
    {


        /// <summary>
        /// 加载配置文件  根节点Configuration
        /// </summary>
        public LocalJobServiceConfig() : base("LocalJobService.cfg", "Configuration")
        {
        }


        /// <summary>
        /// IP 地址
        /// </summary>
        public IP ListeningIP
        {
            get
            {
                return IP.TryParse(base.DocumentElement.GetAttribute("ListeningIP"), IP.Empty);
            }
            set
            {
                base.DocumentElement.SetAttribute("ListeningIP", value.Text);
            }
        }


        /// <summary>
        /// 数据库连接集合
        /// </summary>
        public DBConnectionCollection DBConnections
        {
            get
            {
                return this.GetObjectElement<DBConnectionCollection>("DBConnections");
            }
        }


        /// <summary>
        /// ServiceConfig 节点
        /// </summary>
        public ServiceConfig Service
        {
            get
            {
                return this.GetObjectElement<ServiceConfig>("Service");
            }
        }


    }
}
